using System;
using System.Collections.Generic;
using System.Text;

namespace DigitalTrainSuite
{
	static class DebugMethods
	{
		[System.Diagnostics.Conditional("DEBUG")]
		static public void printDebug(string message)
		{
			Console.WriteLine(message);
		}

		[System.Diagnostics.Conditional("DEBUG")]
		static public void createSampleDataSet(DataSetLayout data)
		{
			data.Track.AddTrackRow(TrackType.Straight.GetHashCode(), 30, 30, 30, 0, 0, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.Track.AddTrackRow(TrackType.Straight.GetHashCode(), 60, 30, 30, 0, 0, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.Connection.AddConnectionRow(data.Track.FindByid(0), 1, data.Track.FindByid(1), 0);
			data.Track.AddTrackRow(TrackType.Straight.GetHashCode(), 90, 30, 30, 0, 0, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.Connection.AddConnectionRow(data.Track.FindByid(1), 1, data.Track.FindByid(2), 0);
			data.Track.AddTrackRow(TrackType.Straight.GetHashCode(), 120, 30, 30, 0, 0, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.Connection.AddConnectionRow(data.Track.FindByid(2), 1, data.Track.FindByid(3), 0);
			data.Track.AddTrackRow(TrackType.Straight.GetHashCode(), 150, 30, 30, 0, 0, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.Connection.AddConnectionRow(data.Track.FindByid(3), 1, data.Track.FindByid(4), 0);
			data.Track.AddTrackRow(TrackType.TurnoutStraightRight.GetHashCode(), 100, 200, 188, 415.5, 24.7, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.Track.AddTrackRow(TrackType.TurnoutStraightRight.GetHashCode(), 300, 200, 188, 415.5, 24.7, System.Drawing.RotateFlipType.RotateNoneFlipNone.GetHashCode());
			data.TurnoutControl.AddTurnoutControlRow(4, 100, 200, 0, 0);
			data.TurnoutControl.AddTurnoutControlRow(5, 300, 200, 0, 0);
			data.WriteXml("sampleDataSet.xml");
			//data.Tracks.AddTracksRow(data.Tracks.idColumn.max
			//data.TurnoutControl.FindByid(0).
		}

		[System.Diagnostics.Conditional("DEBUG")]
		static public void loadSampleDataSet(DataSetLayout data)
		{
			data.ReadXml("sampleDataSet.xml");
		}
	}
}
